package org.happycomp.radiog.utils;

import org.happycomp.radio.ProcessStates;
import org.happycomp.radio.downloader.DownloadingItem;

public class GUIConditions {
	
	public static boolean areItemsInStates(DownloadingItem[] items, ProcessStates... states) {
		for (DownloadingItem itm : items) {
			if (!(isItemInState(itm, states)))  return false;
		}
		return true;
	}

	public static boolean isItemInState(DownloadingItem item, ProcessStates... acceptedStates) {
		for (ProcessStates accState : acceptedStates) {
			if (item.getProcessState().equals(accState)) return true;
		}
		return false;
	}
}
